package com.example.starter.model.interceptor

//import com.example.starter.model.entity.common.BaseEntity
//import com.example.starter.model.entity.common.BaseEntityDraft
//import org.babyfish.jimmer.kt.isLoaded
//import org.babyfish.jimmer.sql.DraftInterceptor
//import java.time.LocalDateTime
//
///**
// * @author Enaium
// */
//class BaseEntityDraftInterceptor : DraftInterceptor<BaseEntityDraft> {
//  override fun beforeSave(draft: BaseEntityDraft, isNew: Boolean) {
//    if (!isLoaded(draft, BaseEntity::modifiedTime)) {
//      draft.modifiedTime = LocalDateTime.now()
//    }
//    if (isNew && !isLoaded(draft, BaseEntity::createdTime)) {
//      draft.createdTime = LocalDateTime.now()
//    }
//  }
//
//
//}
